﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using System.Collections.ObjectModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel;
using System.Data;
using System.Reflection;
using System.Runtime.Serialization;
using System.Data.Objects;

namespace GTServices.Entities
{
    public class MatchInfo : BaseEntity
    {
        [Key, Column(Order = 0)]
        public Guid Id { get; set; }

        public String Line { get; set; }
        public String Context { get; set; }
        public int LineNumber { get; set; }

        public bool Reviewed { get; set; }

        public virtual GrepRequest GrepRequest { get; set; } 
        public virtual FileInfo FileInfo { get; set; }
        public virtual Pattern Pattern { get; set; }

        public MatchInfo()
        {
            Id = Guid.NewGuid(); 
            this.FileInfo = new FileInfo();
        }
        public override void Validate()
        {

        }

        public override bool Equals(object obj)
        {
            if (!(obj is MatchInfo))
            {
                return false;
            }
            return (obj as MatchInfo).Id == this.Id;
        }
    }
}
